<?php
/*
 * @package WordPress
 * @subpackage ZeroWeight
 * 
 * Created by John Przeslakowski
 * http://blog.przeslakowski.com
 *
 */
?>
<?php if (have_posts()) while (have_posts()) : the_post(); ?>

	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
		<section class="zero-hgroup">
			<h1 class="entry-title"><?php the_title(); ?></h1>
			<div class="zero-meta">
				<?php $arc_year = get_the_time('Y'); ?>
				<?php $arc_month = get_the_time('m'); ?>
				<?php $arc_day = get_the_time('d'); ?>
				
				<p>Published on <time pubdate="pubdate" datetime="<?php the_date('Y-m-d'); ?>T<?php the_time('H:i:s'); ?>"><a href="<?php echo get_day_link($arc_year, $arc_month, $arc_day); ?>" title="View posts published on <?php echo get_the_date(); ?>" class="zero-post-date"><?php echo get_the_date(); ?></a> at <span class="zero-post-time"><?php the_time(); ?></span></time> in <span class="zero-post-categories"><?php the_category(', '); ?></span>.</p>
				<p class="zero-last-update">Last updated: <?php echo human_time_diff(get_the_modified_time('U'), current_time('timestamp')) . ' ago'; ?> <?php edit_post_link('Edit'); ?></p>
			</div>
		</section>
		
		<section class="entry-content">
		
			<?php			
			
				if(get_post_format($post->ID) == 'gallery'):
				
					$content = get_the_content();
					$content = str_replace('[gallery]', '[gallery columns="4" link="file"]', $content);
					$content = apply_filters('the_content', $content);
					
					print($content);
					
				else:
				
					the_content();
				
				endif;
				
			?>
			
			<?php wp_link_pages(array('before' => '<nav class="zero-page-links">', 'after' => '</nav>', 'link_before' => '<span>', 'link_after' => '</span>')); ?>
			
		</section>

		<?php if (get_the_author_meta('description')): ?>
			<section class="zero-post-author-box row">
				<section class="zero-author-img"><?php echo get_avatar(get_the_author_meta('user_email'), apply_filters('twentyten_author_bio_avatar_size', 64)); ?></section>
				<section class="zero-author-desc">
					<h4>About <?php the_author(); ?></h4>
					<?php the_author_meta('description'); ?>
					<aside class="zero-author-all-posts">
						<a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>" rel="author">View all posts by <?php the_author(); ?> <span class="meta-nav">&rarr;</span></a>
					</aside>
				</section>				
			</section>
		<?php endif; ?>
		
		<br class="clear" />

		<?php if(!has_tag()): ?>		
			<?php if(current_user_can('administrator') || current_user_can('editor')): ?>
				<p class="zero-msg warning">No tags have been assigned to this post yet. <?php edit_post_link('Tag this post.'); ?></p>
			<?php endif; ?>			
		<?php else: ?>
			<section class="zero-tags">
				<p>Tagged as <?php the_tags('<span class="zero-tag">', '</span>, <span class="zero-tag">', '</span>'); ?></p>				
			</section>
		<?php endif;?>
        
        <p><label for="trackback">Trackback URL:</label><input id="trackback" name="trackback" type="text" readonly="readonly" value="<?php trackback_url(); ?>" /></p>

		<nav class="row">
			<section class="zero-previous six columns alpha"><?php previous_post_link('%link', '<span class="meta-nav">' . '&larr;' . '</span> %title'); ?>&nbsp;</section>
			<section class="zero-next six columns omega">&nbsp;<?php next_post_link('%link', '%title <span class="meta-nav">' . '&rarr;' . '</span>'); ?></section>
		</nav>
		
	</article>
<?php endwhile; ?>